<!doctype html>
{{/* This is a Go HTML template file for goplay */}}
<html>
  <!-- a single HTML file handling the goplay playground. This includes the ability to
       edit, format, run, load, and save Go code.
    -->
  <head>
    <title>Go Play</title>
    <link rel="stylesheet"
	  href={{printf "\"%s/goplay.css\"" .ResourceDir}} />
    <link   rel="shortcut icon"
	   href={{printf "\"%s/favicon.ico\"" .ResourceDir}} />
    <script src={{printf "\"%s/jquery.min.js\"" .ResourceDir}}></script>
    <script src={{printf "\"%s/jquery-linedtextarea.js\"" .ResourceDir}}></script>
    <script src={{printf "\"%s/playground.js\"" .ResourceDir}}></script>
    <script src={{printf "\"%s/fmt.js\""        .ResourceDir}}></script>
    <script src={{printf "\"%s/helper.js\""     .ResourceDir}}></script>
    <script src={{printf "\"%s/linkerror.js\""  .ResourceDir}}></script>
    <script src={{printf "\"%s/timediff.js\""   .ResourceDir}}></script>
    <script src={{printf "\"%s/goplay.js\""     .ResourceDir}}></script>
    <script src={{printf "\"%s/main.js\""       .ResourceDir}}></script>
  </head>
  <body itemscope itemtype="http://schema.org/CreativeWork">
    <div id="banner">
      <div id="head" itemprop="name">Go Play</div>
      <div id="controls">
	<a href="#" title="Reformat via Go's formatter">
	  <input type="button" value="Format"       id="fmt"></a>
	<input type="file"   value="Load"         id="load" name="files[]">
	<input type="button" value="Save"         id="save">
	<input type="text"   value="/tmp/save.go" id="saveLoc">
      </div>
      <div id="sectionTabs">
	<input type="button" value="Settings" id="settingsButton">
	<input type="button" value="About" id="aboutButton">
      </div>
    </div>
    <div id="wrap">
      <textarea itemprop="description" id="code" name="code" autocorrect="off"
		autocomplete="off" autocapatalize="off" spellcheck="false"
		>{{printf "%s" .Snippet.Body |html}}</textarea>
      <div class="hints" id="hints">
	<p>
	<code>Shift-Enter:</code> compile and run; &nbsp; <code>Ctrl-L</code>: Format; &nbsp; <code>Ctrl-S</code>: Save</p>
      </div>
      <div class="output">
	<div class="buttons">
	  <a href="#" title="Compile and run this code [shift-enter]">
	    <button class="run"   id="runbutton">Run</button></a>
	  <a href="#" title="Kill running program">
	    <button class="kill"  id="killbutton">Kill</button></a>
	  <a href="#" title="Remove output from last run">
	    <button class="close" id="clearbutton">Close</button></a>
	</div>
	<div id="output"></div>
      </div>
      <div id="errors"></div>
    </div>
    <div id="about">
<p><b>About Go Play</b></p>

<p>
Go Play is a HTML5 web service that runs on your computer.
</p>

<p>The Go back-end service can format, compile, link, and run Go programs and
return the results.</p>

<p>This code is modification and merger of the <a href="http://play.golang.org">Go playground</a>, the Go <a href="http://godoc.org/code.google.com/p/go.talks/present">present</a> package, and <code>$GOROOT/misc/play</code>.</p>

<p>Input text key assignments
<ul>
<li>Shift-Enter &mdash; Compile and Run</li>
<li>Control-L &mdash; Format Text</li>
<li>Control-S &mdash; Save</li>
</ul>
<p>The code for this package lives
at <a href="https://code.google.com/p/go-play/">https://code.google.com/p/go-play/</a> and was culled together by Rocky Bernstein.</p>

    </div>
    <div id="playsettings">
      <!--- h1 seems to interfere with buster, so use h2. -->
      <h2>Settings</h2>

      <form name="playsettings">
	<input type="checkbox" id="websocket"
	       value="true" checked/>Use Websocket</br>
	<input type="checkbox" id="gotest"
	       value="false"/>Run wth <code>go test</code></br>
	<p><b>source directory: </b> <input type="text" id="srcDir"></p>
	<p><b>tab size: </b>         <input type="text" value="4" maxlength="2"
                                            id="tabSetting"></p>
	<p><b>run options: </b>      <input type="text" id="runOpts"></p>
	<p><b>run environment: </b>  <input type="text" id="runEnv"></p>
	<div id="buildOptsDiv">
	  <p><b>build options: </b>  <input type="text" id="buildOpts"></p>
	</div>
      </form>
    </div>
  </body>
</html>
